package collection;

import java.util.ArrayList;
import java.util.Collection;

/**
 * 集合仅能保存引用类型的元素，并且保存的是元素的地址
 */
public class CollectionDemo3 {
    public static void main(String[] args) {
        Collection c = new ArrayList();
        Point p = new Point(1, 2);
        c.add(p);
        System.out.println(p);
        System.out.println(c);
        p.setX(10);
        System.out.println(p);
        System.out.println(c);
    }

}
